package com.itheima.domain;

import lombok.Data;

import java.text.SimpleDateFormat;
import java.util.Date;

@Data
public class Message {
    private String id;
    private String content;
    private String sendId;
    private String receiveId;
    private String conversationId;
    private Date time;
    private String timeStr;
    private Integer status;
    private Integer unreadCount;
    private User partner;

    // Other Getter and Setter...
    public String getTimeStr() {
        // 用于前端渲染
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        return simpleDateFormat.format(getTime());
    }
}
